package acm.na2005.eastcentral;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;


public class p2009 {

	static int nTest, n, dif;
	static int[] val;
	static Map<String, Integer> map;

	public static void main(String[] args) {
		
//		Scanner scanner = new Scanner(new File("test.in"));
		Scanner scanner  = new Scanner(System.in);
		int count = 0;
		do {
			n = scanner.nextInt();
			if (n == 0) {
				break;
			}
			count++;
			map = new HashMap<String, Integer>();
			val = new int[n+1];
			for (int i=1;i<=n;++i) {
				val[i] = scanner.nextInt();
			}
			dif = solve(1,n);
			System.out.println("In game " + count + ", the greedy strategy might lose by as many as " + dif + " points.");
		} while (true);
	}

	private static int solve(int from, int to) {
		String key = from + "-" + to;
		if (!map.containsKey(key)) {
			int value;
			if (from + 1 == to) {
				value = Math.max(val[from], val[to]) - Math.min(val[from], val[to]);
			}
			else {
				int left, right;
				if (val[from+1] >= val[to]) {
					left = val[from] - val[from+1] + solve(from+2, to);
				}
				else {
					left = val[from] - val[to] + solve(from+1,to-1);
				}
				if (val[from] >= val[to-1]) {
					right = val[to] - val[from] + solve(from+1,to-1);
				}
				else {
					right = val[to] - val[to-1] + solve(from, to-2);
				}
				value = Math.max(left, right); 
			}
			map.put(key, value);
			return value;
		}
		else {
			return map.get(key);
		}
	}

}